package com.yyplatform.admin.platform.role.model.entity;

import java.util.Date;

import com.yyplatform.admin.infra.model.entity.BaseEntity;

import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.Table;
import lombok.Getter;
import lombok.Setter;

/**
 * Created on 2024-09-13
 */
@Entity
@Getter
@Setter
@Table(name = "sys_user_token")
public class SysUserTokenEntity extends BaseEntity {

    @Column(name = "user_id", unique = true, nullable = false, columnDefinition = " bigint(20) comment '用户ID' ")
    private Long userId;

    @Column(name = "username", nullable = false, columnDefinition = " varchar(50) comment '用户名' ")
    private String username;

    @Column(name = "token", unique = true, nullable = false, columnDefinition = " varchar(200) comment '登录token' ")
    private String token;


    @Column(name = "user_agent", nullable = false, columnDefinition = " varchar(200) comment '请求UA' ")
    private String userAgent;

    @Column(name = "ip", nullable = false, columnDefinition = " varchar(50) comment '请求IP' ")
    private String ip;

    @Column(name = "location", nullable = false, columnDefinition = " varchar(200) comment '请求地址' ")
    private String location;

    @Column(name = "browser", nullable = false, columnDefinition = " varchar(200) comment '浏览器' ")
    private String browser;

    @Column(name = "os", nullable = false, columnDefinition = " varchar(50) comment '操作系统'")
    private String os;

    @Column(name = "last_access_time", nullable = false, columnDefinition = " datetime comment '最后访问时间'")
    private Date lastAccessTime;

    @Column(name = "first_access_time", nullable = false, columnDefinition = " datetime comment '首次访问时间' ")
    private Date firstAccessTime;

    @Column(name = "expire_time", nullable = false, columnDefinition = " datetime comment '过期时间' ")
    private Date expireTime;


}
